package com.hoperun.framework.shiro;

import org.apache.shiro.web.tags.AuthenticatedTag;
import org.apache.shiro.web.tags.GuestTag;
import org.apache.shiro.web.tags.HasAnyRolesTag;
import org.apache.shiro.web.tags.HasPermissionTag;
import org.apache.shiro.web.tags.HasRoleTag;
import org.apache.shiro.web.tags.LacksPermissionTag;
import org.apache.shiro.web.tags.LacksRoleTag;
import org.apache.shiro.web.tags.NotAuthenticatedTag;
import org.apache.shiro.web.tags.PrincipalTag;
import org.apache.shiro.web.tags.UserTag;
import org.springframework.stereotype.Component;

import freemarker.template.SimpleHash;

@Component("shiroTags")
public class ShiroTags extends SimpleHash {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public ShiroTags() {
		put("authenticated", new AuthenticatedTag());
		put("guest", new GuestTag());
		put("hasAnyRoles", new HasAnyRolesTag());
		put("hasPermission", new HasPermissionTag());
		put("hasRole", new HasRoleTag());
		put("lacksPermission", new LacksPermissionTag());
		put("lacksRole", new LacksRoleTag());
		put("notAuthenticated", new NotAuthenticatedTag());
		put("principal", new PrincipalTag());
		put("user", new UserTag());
	}
}
